<?php

use yii\db\Migration;

class m191230_083309_project extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="公司项目表"';
        $this->createTable('{{%project}}', [
            'id' => $this->primaryKey(),
            'project_name' => $this->string()->notNull()->comment('项目名称'),
            'pic' => $this->string()->notNull()->comment('项目图'),
            'status' => $this->smallInteger()->notNull()->defaultValue(1)->comment('状态：为1正常，2为删除'),
            'character1' => $this->text()->notNull()->comment('特性1'),
            'character1_info' => $this->text()->notNull()->comment('特性1介绍'),
            'character2' => $this->text()->notNull()->comment('特性2'),
            'character2_info' => $this->text()->notNull()->comment('特性2介绍'),
            'character3' => $this->text()->notNull()->comment('特性3'),
            'character3_info' => $this->text()->notNull()->comment('特性3介绍'),
            'character4' => $this->text()->notNull()->comment('特性4'),
            'character4_info' => $this->text()->notNull()->comment('特性4介绍'),
            'created_at' => $this->integer()->notNull(),
            'updated_at' => $this->integer()->notNull(),
            'deleted_at' => $this->integer(),
        ],$tableOptions);

    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable('{{%project}}');

        return false;
    }
    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
